package mdm.led.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import mdm.led.entity.User;
import mdm.led.entity.UserApp;
import mdm.led.entity.three.FindSelfCheckInspector;
import mdm.led.entity.three.ReceiIissueMan;


@Repository
public interface UserMapper {

    User selectByUsername(String cUsername);
    
    User selectByRolePermission(Integer cUserId);
    
    List<User> selectByCondition(User user);
    
    List<User> findAllDoUser();
    
    int insertSelective(User record);
    
    int insertSelectiveApp(UserApp record);
    
    int updateByPrimaryKeySelective(User record);
    
    User selectById(Integer cUserId);
    
    List<User> selectByRoleId(Integer cUserId);
    
    /**
     * 查询某部门下某职位用户
     * @param did
     * @return
     */
    List<User> findChargeMan(@Param("departmentId")Integer did,@Param("cJobnumber") String cJobnumber);
    /**
     * 查询某部门下未分配外部联系人责任民警
     * @param did
     * @return
     */
    List<User> findResponsiblePolice(@Param("departmentId")Integer did,@Param("cJobnumber") String cJobnumber);
    
    List<User> selectByNickName(String cNickname);
    
    /**
     * 查询指定用户和业务口 的 检查人 , 督查角色
     * @param prot
     * @param selfID
     * @return
     */
    FindSelfCheckInspector findSelfCheckInspector(@Param("prot")Integer prot,@Param("selfID")Integer selfID);
    
    Integer updateState(@Param("userID")Integer userID,@Param("state") Integer state);
    
    /**
     * 查询问题清单接收人   ---- 自查人  自选人
     * @param riskGrade
     * @param selfManID
     * @return
     */
    List<ReceiIissueMan> findReceiIissueMan(@Param("riskGrade") String riskGrade,@Param("selfManID") Integer selfManID);
}
